package net.qiqbframework.rabbitmq;

import lombok.Setter;
import net.qiqbframework.serialization.SerializedObject;
import net.qiqbframework.serialization.SerializedType;
import net.qiqbframework.serialization.SimpleSerializedType;

import java.io.Serializable;

public class RabbitSerializedObject implements SerializedObject<byte[]>, Serializable {

    @Setter
    private byte[] content;

    /**
     * 名称
     */
    @Setter
    private String className;
    /**
     * 版本号
     */
    @Setter
    private String revision;


    @Override
    public Class<byte[]> getContentType() {
        return byte[].class;
    }

    @Override
    public SerializedType getType() {
        return new SimpleSerializedType(className, revision);
    }

    @Override
    public byte[] getData() {
        return content;
    }
}
